<%@ page contentType="text/html; charset=UTF-8"%>
<div style="width: 1000px; margin: 0 auto;display: none;margin-bottom: 30px;margin-top: 30px;" id="deviceUpdatediv">
<table id="deviceUpdateLenngthTable" border="1" style="border-collapse: collapse; width: 100%; border: 1px solid #e4e4e4;">

	
</table>
</div>
<script type="text/javascript">
	getDeviceUpdateLength();
	function getDeviceUpdateLength(){
		
		$.post("deviceConfigAction", {
			"actionType" : "getDeviceConfigInfo"
		}, function(data) {
			var str = "<tr><th class='d'>终端ID</th>";
			str+="<th class='d'>基站1</th>";
			str+="<th class='d'>基站2</th>";		
			str+="<th class='d'>基站3</th>";
			str+="<th class='d'>基站4</th>";
			str+="<th class='d'>操作</th>";
			str+="</tr>";

			for(var key in data){
			 	 str+="<tr>";
			 	str+="<td  class='d'>终端"+key+"</td>";
			 	for(var bsId in data[key].baseStationUpdateLengthMap){
			 		
			 		str+="<td  class='d'><input id='device_"+key+"_"+bsId+"' type='text' value='"+data[key].baseStationUpdateLengthMap[bsId] +"'></td>";
			 	}
			 	str+="<td  class='d'><input type='button'  value='修改' onclick='deviceUpdateLength("+key+")' ></td>";
			 	str+="<tr>";
			}
			
			
			$("#deviceUpdateLenngthTable").html(str);
		},"json");
	}
	
	function deviceUpdateLength(obj){
		
		
		var len1 = $("#device_"+obj+"_1").val();
		var len2 = $("#device_"+obj+"_2").val();
		var len3 = $("#device_"+obj+"_3").val();
		var len4 = $("#device_"+obj+"_4").val();
		
		$.post("deviceConfigAction", {
			"actionType" : "setUpdateLength","len1":len1,"len2":len2,"len3":len3,"len4":len4,"deviceId":obj
		}, function(data) {	
			
			alert(data.msg);
			
		},"json");
	}

</script>